import request from '@/utils/request'
/**
 * 用于获取师傅的信息
 * 1、分页获取师傅的信息
 * 2、添加师傅信息
 * 3、更新师傅信息
 * 4、删除师傅信息
 * 5、获取出诊时间
 * 6、创建师傅管理员
 * 7、获取用户挂自己号的列表
 * **/
// 1、分页获取师傅的信息
export function getDoctorList(specialId, outpatientId, pageNum, pageSize, name) {
  return request({
    url: '/massage/doctor/list/name',
    method: 'get',
    params: {specialId, outpatientId, pageNum, pageSize, name}
  })
}
// 2、添加师傅信息
export function addDoctor(data) {
  return request({
    url: '/massage/doctor',
    method: 'post',
    data
  })
}
// 3、更新师傅信息
export function updateDoctor(id, data) {
  return request({
    url: '/massage/doctor/' + id,
    method: 'put',
    data
  })
}
// 4、删除师傅信息
export function deleteDoctor(id) {
  return request({
    url: '/massage/doctor/' + id,
    method: 'delete'
  })
}
// 获取某个师傅的信息
export function getDoctorInfo(doctorId) {
  return request({
    url: '/massage/doctor/' + doctorId,
    method: 'get'
  })
}
// 5、获取出诊时间
export function getVisitPlanList(doctorId, startDate, endDate) {
  return request({
    url: '/visit/plan/doctor',
    method: 'get',
    params: {doctorId, startDate, endDate}
  })
}
// 6、创建师傅管理员
export function createDoctorManager(data) {
  return request({
    url: '/power/account/admin/register',
    method: 'post',
    data
  })
}
// 7、获取用户挂自己号的列表
export function getPatientList(doctorId, date, time, pageNum, pageSize) {
  return request({
    url: '/visit/appointment/user',
    method: 'get',
    params: {doctorId, date, time, pageNum, pageSize}
  })
}
// 通过师傅id查询预约了该师傅的订单详情
export function getAppointDetail(pageNum,pageSize,doctorId,day,status){
  return request({
    url: '/visit/appointment/doctor/all',
    method: 'get',
    params: {pageNum,pageSize,doctorId,day,status}
  })
}
export function getAllProducts(pageNum, pageSize, name) {
  return request({
    url: '/massage/product/list',
    method: 'get',
    params: {pageNum, pageSize, name}
  })
}
// 完成预约
export function completeAppoint(id) {
  return request({
    url:'/visit/appointment/finish/' + id,
    method:'put'
  })
}
// 取消预约
export function cancelAppoint(id) {
  return request({
    url: '/visit/appointment/cancel/' + id,
    method: 'put'
  })
}
// 根据医院id查医生
export function getDoctorById(massageId,name,pageNum,pageSize){
  return request({
    url: '/massage/getDoctorByMassageId',
    method:'get',
    params:{massageId,name,pageNum,pageSize}
  })
}
// 获取所有医生
export function getAllDoctor(){
  return request({
    url:'/massage/list/doctor',
    method:'get'
  })
}
